package org.example.judge.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.example.judge.mapper.TagMapper;
import org.example.judge.service.TagService;
import org.example.judge_common.util.IdWorker;
import org.example.judge_pojo.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;

@Service("TagServiceImpl")
public class TagServiceImpl extends ServiceImpl<TagMapper, Tag> implements TagService {

    @Autowired
    private IdWorker idWorker;
    @Override
    public boolean save(Tag entity) {
        entity.setUpdateTime(new Date());
        entity.setId(idWorker.nextId().toString());
        return super.save(entity);
    }
}
